package com.nextbusmn.server.dataobjects;

import java.util.HashSet;
import java.util.Set;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable
public class BusTripData implements NextBusData {
	
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;
	
	@Persistent
	private BusRouteData busRoute;
	
	@Persistent
	private int routeID;
	
	@Persistent
	private int serviceType;
	
	@Persistent
	private String tripID;
	
	@Persistent
	private String tripHeadsign;
	
	@Persistent
	private int shapeID;
	
	@Persistent(mappedBy="trip")
	private Set<StopTimeData> stopTimes;
	
	public BusTripData(BusRouteData busRoute,
						int routeID,
					   int serviceType,
					   String tripID,
					   String tripHeadsign,
					   int shapeID) {
		this.busRoute = busRoute;
		this.routeID = routeID;
		this.serviceType = serviceType;
		this.tripID = tripID;
		this.tripHeadsign = tripHeadsign;
		this.stopTimes = new HashSet<StopTimeData>();
		this.shapeID = shapeID;
	}

	public int getServiceType() {
		return serviceType;
	}

	public void setServiceType(int serviceType) {
		this.serviceType = serviceType;
	}

	public String getTripID() {
		return tripID;
	}

	public void setTripID(String tripID) {
		this.tripID = tripID;
	}

	public String getTripHeadsign() {
		return tripHeadsign;
	}

	public void setTripHeadsign(String tripHeadsign) {
		this.tripHeadsign = tripHeadsign;
	}

	public BusRouteData getBusRoute() {
		return busRoute;
	}

	public void setBusRoute(BusRouteData busRoute) {
		this.busRoute = busRoute;
	}

	public Key getKey() {
		return key;
	}

	public void setKey(Key key) {
		this.key = key;
	}

	public int getShapeID() {
		return shapeID;
	}

	public void setShapeID(int shapeID) {
		this.shapeID = shapeID;
	}

	public int getRouteID() {
		return routeID;
	}

	public void setRouteID(int routeID) {
		this.routeID = routeID;
	}

	public Set<StopTimeData> getStopTimes() {
		return stopTimes;
	}

	public void setStopTimes(Set<StopTimeData> stopTimes) {
		this.stopTimes = stopTimes;
	}

}
